$(document).ready(function() {
		
	function resize () {
		
		var right = document.getElementById("right").clientHeight;
		var left = document.getElementById("left").clientHeight;
		var DocHeight = document.documentElement.clientHeight;
		
		if (right > left) {
			document.getElementById("left").style.height = (right) + 'px';
		}
		
		if (DocHeight > (left + 50)) {
			document.getElementById("footerwrap").style.height = (DocHeight - left) + 'px';
			document.getElementById("terms").style.height = (DocHeight - left) + 'px';
		}
	}
	
	resize ();
	
	window.onresize = function() {
		resize ();
	}
	
});
